﻿using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform.Jwt.Services;

namespace MiniFox.Platform.Jwt
{
    /// <summary>
    /// jwt令牌服务接口
    /// </summary>
    [AutoRegister, SpareComponent(typeof(JwtService))]
    public interface IJwtService
    {
        /// <summary>
        /// 获取接入应用信息
        /// </summary>
        /// <param name="accessToken"></param>
        /// <returns></returns>
        ApplicationIdentity GetIdentity(JsonWebToken accessToken);
        /// <summary>
        /// 获取接入的jwt令牌
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="secretKey"></param>
        /// <returns></returns>
        string GetJsonWebToken(string appId, string secretKey);
        /// <summary>
        /// 验证令牌
        /// </summary>
        /// <param name="jwt"></param>
        /// <returns></returns>
        Response VerifyJsonWebToken(string jwt);
    }

}
